/**
 * 
 */
package br.com.framework.app.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.Size;

import br.com.framework.persistencia.model.AuditedEntity;

/**
 * @author Cleber
 *
 */
@Entity
@Table(name = "PAPEL")
public class Papel extends AuditedEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String nome;
	private String descricao;
	
	/**
	 * 
	 */
	public Papel() {
	}
	
	@Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator="SEQ_PAPEL")
	@SequenceGenerator(name="SEQ_PAPEL", sequenceName="SEQ_PAPEL", allocationSize=1, initialValue=0)
	@Column(name = "ID_PAPEL")
	public Long getId() {
		return super.getId();
	}
	
	/**
	 * @return the nome
	 */
	@Column(name = "NOME", length = 255, nullable = false)
	@Size(min = 1, max = 255, message = "{papel.nome.tamanhoInvalido}")
	public String getNome() {
		return nome;
	}

	/**
	 * @param nome the login to set
	 */
	public void setNome(String nome) {
		this.nome = nome;
	}

	/**
	 * @return the descricao
	 */
	@Column(name = "DESCRICAO", length = 255, nullable = true)
	public String getDescricao() {
		return descricao;
	}

	/**
	 * @param desc the descricao to set
	 */
	public void setDescricao(String desc) {
		this.descricao = desc;
	}

}
